#ifndef _TASK_LOSTCOUNTER_H
#define _TASK_LOSTCOUNTER_H
#include "main.h"
#include "bsp_watchdog.h"

#define LOST_COUNTER_TIME_MS (5)

#define NUMBERS_OF_COUNT		16
enum LostCounterType
{
    REMOTE_LOST_COUNT                 = 0,
    JUDGEMENT_LOST_COUNT			  = 1,
    OVER_SPEED_LOST					  = 2,
    OVER_HEAT_LOST					  = 3,
    FEEDMOTOR_LOST_COUNT 			  = 4,
    CHASSIS_MOTOR_0					  = 5,
    CHASSIS_MOTOR_1					  = 6,
	CHASSIS_MOTOR_2					  = 7,
	CHASSIS_MOTOR_3					  = 8,
    FRICTION_LOST_COUNT				  = 9,
	GIMBAL_MOTOR_PITCH				  = 10,
	GIMBAL_MOTOR_YAW				  = 11,
	SUPERC_LOST_COUNT				  = 12,
	VISION_LOST_COUNT				  = 13,
};

#define CHASSIS_LOST_TOLERANCE_MS			200
#define GIMBAL_LOST_TOLERANCE_MS			200
#define REMOTE_LOST_TOLERANCE_MS			200
#define VISION_LOST_TOLERANCE_MS			200
#define JUDGEMENT_LOST_TOLERANCE_MS		    200
#define FEEDMOTOR_LOST_TOLERANCE_MS		    200
#define SUPERC_LOST_TOLERANCE_MS            200

void LostCounterInit(void);
void LostCounterFeed(uint8_t i);
void LostCounterControl(uint16_t SystemErrorStatus);
void LostCounterCount(void);
uint16_t GetErrorState(void);
uint32_t * GetLostCounterData(void);

#endif //_TASK_LOSTCOUNTER_H
